
<!-- target:edit -->
<form class="flex-cont grey-bg vertical-arrangement" name="editCorporatePaymentForm" ui="type:m-panel">
    <input class="ui-hide" name="invoiceType" value="5"/>

    <div class="blank-24"></div>

    <div class="edit-item" ui="type:mao.ui.InputGroup;label:事由;required:true">
        <div ui="type:Text;" class="edit-text">
            <input type="text" name="reasons" value="${detail.reasons}" placeholder="请输入" value="" />
        </div>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:公司抬头;required:true">
        <div class="edit-input placeholder" ui="type:mao.ui.SelectEdit;title:公司抬头;items:&{mao.info.baseInfo.subjectList};name:affiliateCompanyId;value:${detail.affiliateCompanyId};text:${detail.affiliateCompanyName};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:承担人;required:true">
        <!-- var:applyPersonId = ${detail.applyPersonId} || ${mao.staffInfo.staffId} -->
        <!-- var:applyPersonName = ${detail.applyPersonName} || ${mao.staffInfo.staffName} -->
        <div class="edit-input placeholder" ui="type:mao.ui.ChooseDeptStaff;title:承担人;name:applyPersonId;value:${applyPersonId};text:${applyPersonName};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:承担部门;required:true">
        <!-- var:affiliateDepartmentId = ${detail.affiliateDepartmentId} || ${mao.staffInfo.deptList.0.deptId} -->
        <!-- var:affiliateDepartmentName = mao.util.findDept(${affiliateDepartmentId}, ${affiliateDepartmentId}).name -->
        <div class="edit-input placeholder" ui="type:mao.ui.ChooseDeptStaff;isDept;title:承担部门;name:affiliateDepartmentId;value:${affiliateDepartmentId};text:${affiliateDepartmentName};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:备注;">
        <div ui="type:Text;" class="edit-text">
            <input type="text" name="remark" value="${detail.remark}" placeholder="请输入" value="" />
        </div>
    </div>

    <div class="edit-item button-select apply-button-select link-style" ui="type:mao.ui.InputGroup;label:申请单;">
        <!-- var:applicationInvoice = ${detail.applicationInvoice} || {} -->
        <div class="edit-input placeholder" button-text="关联申请单" ui="type:mao.ui.SelectEdit;ext-clear;title:申请单;view:bill.applySelect;sView:bill.applySelectFormItem;name:applicationInvoiceId;value:${detail.applicationInvoice.id};data:&{applicationInvoice};"></div>
        <span class="edit-icon"></span>
    </div>

    <div class="edit-item" ui="type:mao.ui.InputGroup;label:往来单位;required:true">
        <div class="edit-input placeholder" ui="type:mao.ui.SelectEdit;id:accountUnit;title:往来单位;name:contactUnitCode;items:&{NS.unitList};value:${detail.contactUnitCode};text:${detail.contactUnitName};"></div>
        <span class="edit-icon"></span>
    </div>

    <div class="edit-item button-select apply-button-select" ui="type:mao.ui.InputGroup;label:收款账户;required:true">
        <!-- var:accountInfo = ${detail.accountInfo} || {} -->
        <div class="edit-input placeholder" button-text="选择收款账户" ui="type:NS.AccountSelectEdit;accountUnit:accountUnit;title:收款账户;view:bill.accountSingleSelect;sView:bill.accountSingleSelectItem;name:accountId;value:${detail.accountInfo.accountId};data:&{accountInfo}"></div>
        <span class="edit-icon"></span>
    </div>

    <div class="edit-item button-select apply-button-select link-style" ui="type:mao.ui.InputGroup;label:关联项目;">
        <!-- var:project = ${detail.project} || {} -->
        <div class="edit-input placeholder" button-text="关联项目" ui="type:mao.ui.SelectEdit;ext-clear;title:关联项目;view:bill.brandProjectSelect;sView:bill.brandProjectSelectFormItem;name:projectId;value:${detail.project.id};data:&{project};"></div>
        <span class="edit-icon"></span>
    </div>

    <input ui="type:ecui.esr.CreateArray" name="costDetails" type="text" class="ui-hide" />
    <div class="edit-item button-select book-select" ui="type:mao.ui.InputGroup;label:费用明细;required:true">
        <div class="edit-input placeholder">
            <div class="cost-items info-part cost-plan" id="cost_cont_${num}">
                <!-- for:${detail.costDetails} as ${item},${index} -->
                    <!-- use:bill.costItem(item=${item},name='costDetails',i=${index},num=${num}) -->
                <!-- /for -->
            </div>
            <div class="ui-button" ui="type:NS.AddCostBtn;ext-calculate-cost:${num};route:/finance/book.edit~fromEdit=true~DENY_CACHE;regexp:.{0};text:新建费用"></div>
            <div class="ui-button fr" ui="type:NS.ImportCostBtn;ext-calculate-cost:${num};view:bill.applyCostSelect;title:费用明细;regexp:.{0};invoiceType:5;text:从账本导入;placeholder:从账本导入;"></div>
        </div>
        <span class="edit-icon"></span>
    </div>


    <!-- use:uploadFile -->
    <!-- use:approvalAndSendPeople -->

    <div class="blank-24"></div>
</form>

<div class="bottom-box flex align-center" id="calculate_total_${num}">
    <div class="flex-1">
        <div class="finance-info">企业应付：<span class="unit">￥</span><span class="num cost-total">0.00</span></div>
    </div>
    <div class="btn-box">
        <div class="ui-button ui-hide" ui="type:NS.SaveBillBtn;invoiceType:5;">暂存</div>
        <div class="ui-button ui-button-primary" ui="type:NS.SaveBillBtn;invoiceType:5;">确定</div>
    </div>
</div>
